FROM frolvlad/alpine-glibc:glibc-2.34 AS jre
ADD jre-8u211-linux-x64.tar.gz /
RUN cd /jre1.8.0_211 \
    && rm -rf COPYRIGHT LICENSE README release THIRDPARTYLICENSEREADME-JAVAFX.txt THIRDPARTYLICENSEREADME.txt Welcome.html \
    && rm -rf lib/plugin.jar \
           lib/ext/jfxrt.jar \
           bin/javaws \
           lib/javaws.jar \
           lib/desktop \
           plugin \
           lib/deploy* \
           lib/*javafx* \
           lib/*jfx* \
           lib/amd64/libdecora_sse.so \
           lib/amd64/libprism_*.so \
           lib/amd64/libfxplugins.so \
           lib/amd64/libglass.so \
           lib/amd64/libgstreamer-lite.so \
           lib/amd64/libjavafx*.so \
           lib/amd64/libjfx*.so

FROM ubuntu:20.04
ENV TZ Asia/Shanghai
COPY --from=jre /jre1.8.0_211 /jre1.8.0_211
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list\
    && sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list\
    &&  apt-get -y update && apt-get install -y tzdata curl \
    && echo ${TZ} > /etc/timezone \
    && apt-get clean all \
    && rm -rf /var/cache/apt
ENV JAVA_HOME=/jre1.8.0_211
ENV PATH=$JAVA_HOME/bin:$PATH
EXPOSE 80 8080